home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tk4.0 / tkInt.h < prev    next >
C/C++ Source or Header  |  1995-06-24  |  26KB  |  729 lines

  1. /*
  2.  * tkInt.h --
  3.  *
  4.  *    Declarations for things used internally by the Tk
  5.  *    procedures but not exported outside the module.
  6.  *
  7.  * Copyright (c) 1990-1994 The Regents of the University of California.
  8.  * Copyright (c) 1994 Sun Microsystems, Inc.
  9.  *
  10.  * See the file "license.terms" for information on usage and redistribution
  11.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12.  *
  13.  * @(#) tkInt.h 1.147 95/06/24 17:12:55
  14.  */
  15.  
  16. #ifndef _TKINT
  17. #define _TKINT
  18.  
  19. #ifndef _XLIB_H_
  20. #include <X11/Xlib.h>
  21. #endif
  22. #ifndef _XUTIL_H
  23. #include <X11/Xutil.h>
  24. #endif
  25. #ifndef _TK
  26. #include "tk.h"
  27. #endif
  28. #ifndef _TCL
  29. #include "tcl.h"
  30. #endif
  31.  
  32. /*
  33.  * Opaque type declarations:
  34.  */
  35.  
  36. typedef struct TkColormap TkColormap;
  37. typedef struct TkGrabEvent TkGrabEvent;
  38. typedef struct Tk_PostscriptInfo Tk_PostscriptInfo;
  39. typedef struct TkStressedCmap TkStressedCmap;
  40.  
  41. /*
  42.  * One of the following structures is maintained for each display
  43.  * containing a window managed by Tk:
  44.  */
  45.  
  46. typedef struct TkDisplay {
  47.     Display *display;        /* Xlib's info about display. */
  48.     struct TkDisplay *nextPtr;    /* Next in list of all displays. */
  49.     char *name;            /* Name of display (with any screen
  50.                  * identifier removed).  Malloc-ed. */
  51.     Time lastEventTime;        /* Time of last event received for this
  52.                  * display. */
  53.  
  54.     /*
  55.      * Information used primarily by tkBind.c:
  56.      */
  57.  
  58.     int bindInfoStale;        /* Non-zero means the variables in this
  59.                  * part of the structure are potentially
  60.                  * incorrect and should be recomputed. */
  61.     unsigned int modeModMask;    /* Has one bit set to indicate the modifier
  62.                  * corresponding to "mode shift".  If no
  63.                  * such modifier, than this is zero. */
  64.     unsigned int metaModMask;    /* Has one bit set to indicate the modifier
  65.                  * corresponding to the "Meta" key.  If no
  66.                  * such modifier, then this is zero. */
  67.     unsigned int altModMask;    /* Has one bit set to indicate the modifier
  68.                  * corresponding to the "Meta" key.  If no
  69.                  * such modifier, then this is zero. */
  70.     enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
  71.                 /* Indicates how to interpret lock modifier. */
  72.     int numModKeyCodes;        /* Number of entries in modKeyCodes array
  73.                  * below. */
  74.     KeyCode *modKeyCodes;    /* Pointer to an array giving keycodes for
  75.                  * all of the keys that have modifiers
  76.                  * associated with them.  Malloc'ed, but
  77.                  * may be NULL. */
  78.  
  79.     /*
  80.      * Information used by tkError.c only:
  81.      */
  82.  
  83.     struct TkErrorHandler *errorPtr;
  84.                 /* First in list of error handlers
  85.                  * for this display.  NULL means
  86.                  * no handlers exist at present. */
  87.     int deleteCount;        /* Counts # of handlers deleted since
  88.                  * last time inactive handlers were
  89.                  * garbage-collected.  When this number
  90.                  * gets big, handlers get cleaned up. */
  91.  
  92.     /*
  93.      * Information used by tkSend.c only:
  94.      */
  95.  
  96.     Tk_Window commTkwin;    /* Window used for communication
  97.                  * between interpreters during "send"
  98.                  * commands.  NULL means send info hasn't
  99.                  * been initialized yet. */
  100.     Atom commProperty;        /* X's name for comm property. */
  101.     Atom registryProperty;    /* X's name for property containing
  102.                  * registry of interpreter names. */
  103.     Atom appNameProperty;    /* X's name for property used to hold the
  104.                  * application name on each comm window. */
  105.  
  106.     /*
  107.      * Information used by tkSelect.c and tkClipboard.c only:
  108.      */
  109.  
  110.     struct TkSelectionInfo *selectionInfoPtr;
  111.                 /* First in list of selection information
  112.                  * records.  Each entry contains information
  113.                  * about the current owner of a particular
  114.                  * selection on this display. */
  115.     Atom multipleAtom;        /* Atom for MULTIPLE.  None means
  116.                  * selection stuff isn't initialized. */
  117.     Atom incrAtom;        /* Atom for INCR. */
  118.     Atom targetsAtom;        /* Atom for TARGETS. */
  119.     Atom timestampAtom;        /* Atom for TIMESTAMP. */
  120.     Atom textAtom;        /* Atom for TEXT. */
  121.     Atom compoundTextAtom;    /* Atom for COMPOUND_TEXT. */
  122.     Atom applicationAtom;    /* Atom for TK_APPLICATION. */
  123.     Atom windowAtom;        /* Atom for TK_WINDOW. */
  124.     Atom clipboardAtom;        /* Atom for CLIPBOARD. */
  125.  
  126.     Tk_Window clipWindow;    /* Window used for clipboard ownership and to
  127.                  * retrieve selections between processes. NULL
  128.                  * means clipboard info hasn't been
  129.                  * initialized. */
  130.     int clipboardActive;    /* 1 means we currently own the clipboard
  131.                  * selection, 0 means we don't. */
  132.     struct TkMainInfo *clipboardAppPtr;
  133.                 /* Last application that owned clipboard. */
  134.     struct TkClipboardTarget *clipTargetPtr;
  135.                 /* First in list of clipboard type information
  136.                  * records.  Each entry contains information
  137.                  * about the buffers for a given selection
  138.                  * target. */
  139.  
  140.     /*
  141.      * Information used by tkAtom.c only:
  142.      */
  143.  
  144.     int atomInit;        /* 0 means stuff below hasn't been
  145.                  * initialized yet. */
  146.     Tcl_HashTable nameTable;    /* Maps from names to Atom's. */
  147.     Tcl_HashTable atomTable;    /* Maps from Atom's back to names. */
  148.  
  149.     /*
  150.      * Information used by tkCursor.c only:
  151.      */
  152.  
  153.     Font cursorFont;        /* Font to use for standard cursors.
  154.                  * None means font not loaded yet. */
  155.  
  156.     /*
  157.      * Information used by tkGrab.c only:
  158.      */
  159.  
  160.     struct TkWindow *grabWinPtr;
  161.                 /* Window in which the pointer is currently
  162.                  * grabbed, or NULL if none. */
  163.     struct TkWindow *eventualGrabWinPtr;
  164.                 /* Value that grabWinPtr will have once the
  165.                  * grab event queue (below) has been
  166.                  * completely emptied. */
  167.     struct TkWindow *buttonWinPtr;
  168.                 /* Window in which first mouse button was
  169.                  * pressed while grab was in effect, or NULL
  170.                  * if no such press in effect. */
  171.     struct TkWindow *serverWinPtr;
  172.                 /* If no application contains the pointer then
  173.                  * this is NULL.  Otherwise it contains the
  174.                  * last window for which we've gotten an
  175.                  * Enter or Leave event from the server (i.e.
  176.                  * the last window known to have contained
  177.                  * the pointer).  Doesn't reflect events
  178.                  * that were synthesized in tkGrab.c. */
  179.     TkGrabEvent *firstGrabEventPtr;
  180.                 /* First in list of enter/leave events
  181.                  * synthesized by grab code.  These events
  182.                  * must be processed in order before any other
  183.                  * events are processed.  NULL means no such
  184.                  * events. */
  185.     TkGrabEvent *lastGrabEventPtr;
  186.                 /* Last in list of synthesized events, or NULL
  187.                  * if list is empty. */
  188.     int grabFlags;        /* Miscellaneous flag values.  See definitions
  189.                  * in tkGrab.c. */
  190.  
  191.     /*
  192.      * Information used by tkXId.c only:
  193.      */
  194.  
  195.     struct TkIdStack *idStackPtr;
  196.                 /* First in list of chunks of free resource
  197.                  * identifiers, or NULL if there are no free
  198.                  * resources. */
  199.     XID (*defaultAllocProc) _ANSI_ARGS_((Display *display));
  200.                 /* Default resource allocator for display. */
  201.     struct TkIdStack *windowStackPtr;
  202.                 /* First in list of chunks of window
  203.                  * identifers that can't be reused right
  204.                  * now. */
  205.     int idCleanupScheduled;    /* 1 means a call to WindowIdCleanup has
  206.                  * already been scheduled, 0 means it
  207.                  * hasn't. */
  208.  
  209.     /*
  210.      * Information maintained by tkWindow.c for use later on by tkXId.c:
  211.      */
  212.  
  213.  
  214.     int destroyCount;        /* Number of Tk_DestroyWindow operations
  215.                  * in progress. */
  216.     unsigned long lastDestroyRequest;
  217.                 /* Id of most recent XDestroyWindow request;
  218.                  * can re-use ids in windowStackPtr when
  219.                  * server has seen this request and event
  220.                  * queue is empty. */
  221.  
  222.     /*
  223.      * Information used by tkVisual.c only:
  224.      */
  225.  
  226.     TkColormap *cmapPtr;    /* First in list of all non-default colormaps
  227.                  * allocated for this display. */
  228.  
  229.     /*
  230.      * Information used by tkFocus.c only:
  231.      */
  232.  
  233.     struct TkWindow *focusWinPtr;
  234.                 /* Window that currently has the focus for
  235.                  * this display, or NULL if none. */
  236.     struct TkWindow *implicitWinPtr;
  237.                 /* If the focus arrived at a toplevel window
  238.                  * implicitly via an Enter event (rather
  239.                  * than via a FocusIn event), this points
  240.                  * to the toplevel window.  Otherwise it is
  241.                  * NULL. */
  242.     struct TkWindow *focusOnMapPtr;
  243.                 /* This points to a toplevel window that is
  244.                  * supposed to receive the X input focus as
  245.                  * soon as it is mapped (needed to handle the
  246.                  * fact that X won't allow the focus on an
  247.                  * unmapped window).  NULL means no delayed
  248.                  * focus op in progress. */
  249.     int forceFocus;        /* Associated with focusOnMapPtr:  non-zero
  250.                  * means claim the focus even if some other
  251.                  * application currently has it. */
  252.  
  253.     /*
  254.      * Used by tkColor.c only:
  255.      */
  256.  
  257.     TkStressedCmap *stressPtr;    /* First in list of colormaps that have
  258.                  * filled up, so we have to pick an
  259.                  * approximate color. */
  260.  
  261.     /*
  262.      * Miscellaneous information:
  263.      */
  264.  
  265. #ifdef TK_USE_INPUT_METHODS
  266.     XIM inputMethod;        /* Input method for this display */
  267. #endif /* TK_USE_INPUT_METHODS */
  268.     Tcl_HashTable winTable;    /* Maps from X window ids to TkWindow ptrs. */
  269. } TkDisplay;
  270.  
  271. /*
  272.  * One of the following structures exists for each error handler
  273.  * created by a call to Tk_CreateErrorHandler.  The structure
  274.  * is managed by tkError.c.
  275.  */
  276.  
  277. typedef struct TkErrorHandler {
  278.     TkDisplay *dispPtr;        /* Display to which handler applies. */
  279.     unsigned long firstRequest;    /* Only errors with serial numbers
  280.                  * >= to this are considered. */
  281.     unsigned long lastRequest;    /* Only errors with serial numbers
  282.                  * <= to this are considered.  This
  283.                  * field is filled in when XUnhandle
  284.                  * is called.  -1 means XUnhandle
  285.                  * hasn't been called yet. */
  286.     int error;            /* Consider only errors with this
  287.                  * error_code (-1 means consider
  288.                  * all errors). */
  289.     int request;        /* Consider only errors with this
  290.                  * major request code (-1 means
  291.                  * consider all major codes). */
  292.     int minorCode;        /* Consider only errors with this
  293.                  * minor request code (-1 means
  294.                  * consider all minor codes). */
  295.     Tk_ErrorProc *errorProc;    /* Procedure to invoke when a matching
  296.                  * error occurs.  NULL means just ignore
  297.                  * errors. */
  298.     ClientData clientData;    /* Arbitrary value to pass to
  299.                  * errorProc. */
  300.     struct TkErrorHandler *nextPtr;
  301.                 /* Pointer to next older handler for
  302.                  * this display, or NULL for end of
  303.                  * list. */
  304. } TkErrorHandler;
  305.  
  306. /*
  307.  * One of the following structures exists for each event handler
  308.  * created by calling Tk_CreateEventHandler.  This information
  309.  * is used by tkEvent.c only.
  310.  */
  311.  
  312. typedef struct TkEventHandler {
  313.     unsigned long mask;        /* Events for which to invoke
  314.                  * proc. */
  315.     Tk_EventProc *proc;        /* Procedure to invoke when an event
  316.                  * in mask occurs. */
  317.     ClientData clientData;    /* Argument to pass to proc. */
  318.     struct TkEventHandler *nextPtr;
  319.                 /* Next in list of handlers
  320.                  * associated with window (NULL means
  321.                  * end of list). */
  322. } TkEventHandler;
  323.  
  324. /*
  325.  * Tk keeps one of the following data structures for each main
  326.  * window (created by a call to Tk_CreateMainWindow).  It stores
  327.  * information that is shared by all of the windows associated
  328.  * with a particular main window.
  329.  */
  330.  
  331. typedef struct TkMainInfo {
  332.     int refCount;        /* Number of windows whose "mainPtr" fields
  333.                  * point here.  When this becomes zero, can
  334.                  * free up the structure (the reference
  335.                  * count is zero because windows can get
  336.                  * deleted in almost any order;  the main
  337.                  * window isn't necessarily the last one
  338.                  * deleted). */
  339.     struct TkWindow *winPtr;    /* Pointer to main window. */
  340.     Tcl_Interp *interp;        /* Interpreter associated with application. */
  341.     Tcl_HashTable nameTable;    /* Hash table mapping path names to TkWindow
  342.                  * structs for all windows related to this
  343.                  * main window.  Managed by tkWindow.c. */
  344.     Tk_BindingTable bindingTable;
  345.                 /* Used in conjunction with "bind" command
  346.                  * to bind events to Tcl commands. */
  347.     TkDisplay *curDispPtr;    /* Display for last binding command invoked
  348.                  * in this application;  used only  by
  349.                  * tkBind.c. */
  350.     int curScreenIndex;        /* Index of screen for last binding command.
  351.                  * Used only by tkBind.c. */
  352.     int bindingDepth;        /* Number of active instances of Tk_BindEvent
  353.                  * in this application.  Used only by
  354.                  * tkBind.c. */
  355.     struct TkFocusInfo *focusPtr;
  356.                 /* First in list of records containing focus
  357.                  * information for each top-level in the
  358.                  * application.  Used only by tkFocus.c. */
  359.     unsigned long focusSerial;    /* Serial number of last request we made to
  360.                  * change the focus.  Used to identify
  361.                  * stale focus notifications coming from the
  362.                  * X server. */
  363.     struct TkWindow *lastFocusPtr;
  364.                 /* The most recent window that was given the
  365.                  * focus via "focus" command.  Used to restore
  366.                  * the focus when we get stale FocusIn
  367.                  * events. */
  368.     struct ElArray *optionRootPtr;
  369.                 /* Top level of option hierarchy for this
  370.                  * main window.  NULL means uninitialized.
  371.                  * Managed by tkOption.c. */
  372.     Tcl_HashTable imageTable;    /* Maps from image names to Tk_ImageMaster
  373.                  * structures.  Managed by tkImage.c. */
  374.     int strictMotif;        /* This is linked to the tk_strictMotif
  375.                  * global variable. */
  376.     struct TkMainInfo *nextPtr;    /* Next in list of all main windows managed by
  377.                  * this process. */
  378. } TkMainInfo;
  379.  
  380. /*
  381.  * Tk keeps one of the following structures for each window.
  382.  * Some of the information (like size and location) is a shadow
  383.  * of information managed by the X server, and some is special
  384.  * information used here, such as event and geometry management
  385.  * information.  This information is (mostly) managed by tkWindow.c.
  386.  * WARNING: the declaration below must be kept consistent with the
  387.  * Tk_FakeWin structure in tk.h.  If you change one, be sure to
  388.  * change the other!!
  389.  */
  390.  
  391. typedef struct TkWindow {
  392.  
  393.     /*
  394.      * Structural information:
  395.      */
  396.  
  397.     Display *display;        /* Display containing window. */
  398.     TkDisplay *dispPtr;        /* Tk's information about display
  399.                  * for window. */
  400.     int screenNum;        /* Index of screen for window, among all
  401.                  * those for dispPtr. */
  402.     Visual *visual;        /* Visual to use for window.  If not default,
  403.                  * MUST be set before X window is created. */
  404.     int depth;            /* Number of bits/pixel. */
  405.     Window window;        /* X's id for window.   NULL means window
  406.                  * hasn't actually been created yet, or it's
  407.                  * been deleted. */
  408.     struct TkWindow *childList;    /* First in list of child windows,
  409.                  * or NULL if no children. */
  410.     struct TkWindow *lastChildPtr;
  411.                 /* Last in list of child windows, or NULL
  412.                  * if no children. */
  413.     struct TkWindow *parentPtr;    /* Pointer to parent window (logical
  414.                  * parent, not necessarily X parent).  NULL
  415.                  * means either this is the main window, or
  416.                  * the window's parent has already been
  417.                  * deleted. */
  418.     struct TkWindow *nextPtr;    /* Next in list of children with
  419.                  * same parent (NULL if end of
  420.                  * list). */
  421.     TkMainInfo *mainPtr;    /* Information shared by all windows
  422.                  * associated with a particular main
  423.                  * window.  NULL means this window is
  424.                  * a rogue that isn't associated with
  425.                  * any application (at present, this
  426.                  * only happens for the dummy windows
  427.                  * used for "send" communication).  */
  428.  
  429.     /*
  430.      * Name and type information for the window:
  431.      */
  432.  
  433.     char *pathName;        /* Path name of window (concatenation
  434.                  * of all names between this window and
  435.                  * its top-level ancestor).  This is a
  436.                  * pointer into an entry in
  437.                  * mainPtr->nameTable.  NULL means that
  438.                  * the window hasn't been completely
  439.                  * created yet. */
  440.     Tk_Uid nameUid;        /* Name of the window within its parent
  441.                  * (unique within the parent). */
  442.     Tk_Uid classUid;        /* Class of the window.  NULL means window
  443.                  * hasn't been given a class yet. */
  444.  
  445.     /*
  446.      * Geometry and other attributes of window.  This information
  447.      * may not be updated on the server immediately;  stuff that
  448.      * hasn't been reflected in the server yet is called "dirty".
  449.      * At present, information can be dirty only if the window
  450.      * hasn't yet been created.
  451.      */
  452.  
  453.     XWindowChanges changes;    /* Geometry and other info about
  454.                  * window. */
  455.     unsigned int dirtyChanges;    /* Bits indicate fields of "changes"
  456.                  * that are dirty. */
  457.     XSetWindowAttributes atts;    /* Current attributes of window. */
  458.     unsigned long dirtyAtts;    /* Bits indicate fields of "atts"
  459.                  * that are dirty. */
  460.  
  461.     unsigned int flags;        /* Various flag values:  these are all
  462.                  * defined in tk.h (confusing, but they're
  463.                  * needed there for some query macros). */
  464.  
  465.     /*
  466.      * Information kept by the event manager (tkEvent.c):
  467.      */
  468.  
  469.     TkEventHandler *handlerList;/* First in list of event handlers
  470.                  * declared for this window, or
  471.                  * NULL if none. */
  472. #ifdef TK_USE_INPUT_METHODS
  473.     XIC inputContext;        /* Input context (for input methods). */
  474. #endif /* TK_USE_INPUT_METHODS */
  475.  
  476.     /*
  477.      * Information used for event bindings (see "bind" and "bindtags"
  478.      * commands in tkCmds.c):
  479.      */
  480.  
  481.     ClientData *tagPtr;        /* Points to array of tags used for bindings
  482.                  * on this window.  Each tag is a Tk_Uid.
  483.                  * Malloc'ed.  NULL means no tags. */
  484.     int numTags;        /* Number of tags at *tagPtr. */
  485.  
  486.     /*
  487.      * Information used by tkOption.c to manage options for the
  488.      * window.
  489.      */
  490.  
  491.     int optionLevel;        /* -1 means no option information is
  492.                  * currently cached for this window.
  493.                  * Otherwise this gives the level in
  494.                  * the option stack at which info is
  495.                  * cached. */
  496.     /*
  497.      * Information used by tkSelect.c to manage the selection.
  498.      */
  499.  
  500.     struct TkSelHandler *selHandlerList;
  501.                 /* First in list of handlers for
  502.                  * returning the selection in various
  503.                  * forms. */
  504.  
  505.     /*
  506.      * Information used by tkGeometry.c for geometry management.
  507.      */
  508.  
  509.     Tk_GeomMgr *geomMgrPtr;    /* Information about geometry manager for
  510.                  * this window. */
  511.     ClientData geomData;    /* Argument for geometry manager procedures. */
  512.     int reqWidth, reqHeight;    /* Arguments from last call to
  513.                  * Tk_GeometryRequest, or 0's if
  514.                  * Tk_GeometryRequest hasn't been
  515.                  * called. */
  516.     int internalBorderWidth;    /* Width of internal border of window
  517.                  * (0 means no internal border).  Geometry
  518.                  * managers should not normally place children
  519.                  * on top of the border. */
  520.  
  521.     /*
  522.      * Information maintained by tkWm.c for window manager communication.
  523.      */
  524.  
  525.     struct TkWmInfo *wmInfoPtr;    /* For top-level windows, points to
  526.                  * structure with wm-related info (see
  527.                  * tkWm.c).  For other windows, this
  528.                  * is NULL. */
  529. } TkWindow;
  530.  
  531. /*
  532.  * Pointer to first entry in list of all displays currently known.
  533.  */
  534.  
  535. extern TkDisplay *tkDisplayList;
  536.  
  537. /*
  538.  * Flags passed to TkMeasureChars:
  539.  */
  540.  
  541. #define TK_WHOLE_WORDS         1
  542. #define TK_AT_LEAST_ONE         2
  543. #define TK_PARTIAL_OK         4
  544. #define TK_NEWLINES_NOT_SPECIAL     8
  545. #define TK_IGNORE_TABS        16
  546.  
  547. /*
  548.  * Return values from TkGrabState:
  549.  */
  550.  
  551. #define TK_GRAB_NONE        0
  552. #define TK_GRAB_IN_TREE        1
  553. #define TK_GRAB_ANCESTOR    2
  554. #define TK_GRAB_EXCLUDED    3
  555.  
  556. /*
  557.  * Location of library directory containing Tk scripts.  This value
  558.  * is put in the $tkLibrary variable for each application.
  559.  */
  560.  
  561. #ifndef TK_LIBRARY
  562. #define TK_LIBRARY "/usr/local/lib/tk"
  563. #endif
  564.  
  565. /*
  566.  * Special flag to pass to Tk_CreateFileHandler to indicate that
  567.  * the file descriptor is actually for a display, not a file, and
  568.  * should be treated specially.  Make sure that this value doesn't
  569.  * conflict with TK_READABLE, TK_WRITABLE, or TK_EXCEPTION from tk.h.
  570.  */
  571.  
  572. #define TK_IS_DISPLAY    32
  573.  
  574. /*
  575.  * The macro below is used to modify a "char" value (e.g. by casting
  576.  * it to an unsigned character) so that it can be used safely with
  577.  * macros such as isspace.
  578.  */
  579.  
  580. #define UCHAR(c) ((unsigned char) (c))
  581.  
  582. /*
  583.  * Miscellaneous variables shared among Tk modules but not exported
  584.  * to the outside world:
  585.  */
  586.  
  587. extern Tk_Uid            tkActiveUid;
  588. extern Tk_ImageType        tkBitmapImageType;
  589. extern void            (*tkDelayedEventProc) _ANSI_ARGS_((void));
  590. extern Tk_Uid            tkDisabledUid;
  591. extern Tk_PhotoImageFormat    tkImgFmtGIF;
  592. extern Tk_PhotoImageFormat    tkImgFmtPPM;
  593. extern TkMainInfo        *tkMainWindowList;
  594. extern Tk_Uid            tkNormalUid;
  595. extern Tk_ImageType        tkPhotoImageType;
  596. extern int            tkSendSerial;
  597.  
  598. /*
  599.  * Internal procedures shared among Tk modules but not exported
  600.  * to the outside world:
  601.  */
  602.  
  603. extern int        TkAreaToPolygon _ANSI_ARGS_((double *polyPtr,
  604.                 int numPoints, double *rectPtr));
  605. extern void        TkBezierPoints _ANSI_ARGS_((double control[],
  606.                 int numSteps, double *coordPtr));
  607. extern void        TkBezierScreenPoints _ANSI_ARGS_((Tk_Canvas canvas,
  608.                 double control[], int numSteps,
  609.                 XPoint *xPointPtr));
  610. extern void        TkBindEventProc _ANSI_ARGS_((TkWindow *winPtr,
  611.                 XEvent *eventPtr));
  612. extern int        TkClipInit _ANSI_ARGS_((Tcl_Interp *interp,
  613.                 TkDisplay *dispPtr));
  614. extern int        TkCmapStressed _ANSI_ARGS_((Tk_Window tkwin,
  615.                 Colormap colormap));
  616. extern void        TkComputeTextGeometry _ANSI_ARGS_((
  617.                 XFontStruct *fontStructPtr, char *string,
  618.                 int numChars, int wrapLength, int *widthPtr,
  619.                 int *heightPtr));
  620. extern int        TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp,
  621.                 char *script));
  622. extern Time        TkCurrentTime _ANSI_ARGS_((TkDisplay *dispPtr));
  623. extern int        TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
  624.                 Tcl_Interp *interp, int argc, char **argv));
  625. extern void        TkDeleteAllImages _ANSI_ARGS_((TkMainInfo *mainPtr));
  626. extern void        TkDisplayChars _ANSI_ARGS_((Display *display,
  627.                 Drawable drawable, GC gc,
  628.                 XFontStruct *fontStructPtr, char *string,
  629.                 int numChars, int x, int y, int tabOrigin,
  630.                 int flags));
  631. extern void        TkDisplayText _ANSI_ARGS_((Display *display,
  632.                 Drawable drawable, XFontStruct *fontStructPtr,
  633.                 char *string, int numChars, int x, int y,
  634.                 int length, Tk_Justify justify, int underline,
  635.                 GC gc));
  636. extern void        TkEventCleanupProc _ANSI_ARGS_((
  637.                 ClientData clientData, Tcl_Interp *interp));
  638. extern void        TkEventDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  639. extern void        TkFillPolygon _ANSI_ARGS_((Tk_Canvas canvas,
  640.                 double *coordPtr, int numPoints, Display *display,
  641.                 Drawable drawable, GC gc, GC outlineGC));
  642. extern void        TkFocusDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  643. extern int        TkFocusFilterEvent _ANSI_ARGS_((TkWindow *winPtr,
  644.                 XEvent *eventPtr));
  645. extern void        TkFreeBindingTags _ANSI_ARGS_((TkWindow *winPtr));
  646. extern void        TkFreeWindowId _ANSI_ARGS_((TkDisplay *dispPtr,
  647.                 Window w));
  648. extern void        TkGetButtPoints _ANSI_ARGS_((double p1[], double p2[],
  649.                 double width, int project, double m1[],
  650.                 double m2[]));
  651. extern TkDisplay *    TkGetDisplay _ANSI_ARGS_((Display *display));
  652. extern TkWindow *    TkGetFocus _ANSI_ARGS_((TkWindow *winPtr));
  653. extern int        TkGetInterpNames _ANSI_ARGS_((Tcl_Interp *interp,
  654.                 Tk_Window tkwin));
  655. extern int        TkGetMiterPoints _ANSI_ARGS_((double p1[], double p2[],
  656.                 double p3[], double width, double m1[],
  657.                 double m2[]));
  658. extern void        TkGetPointerCoords _ANSI_ARGS_((Tk_Window tkwin,
  659.                 int *xPtr, int *yPtr));
  660. extern void        TkGetServerInfo _ANSI_ARGS_((Tcl_Interp *interp,
  661.                 Tk_Window tkwin));
  662. extern void        TkGrabDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  663. extern int        TkGrabState _ANSI_ARGS_((TkWindow *winPtr));
  664. extern void        TkGrabTriggerProc _ANSI_ARGS_((XEvent *eventPtr));
  665. extern void        TkIncludePoint _ANSI_ARGS_((Tk_Item *itemPtr,
  666.                 double *pointPtr));
  667. extern char *        TkInitFrame _ANSI_ARGS_((Tcl_Interp *interp,
  668.                 Tk_Window tkwin, int toplevel, int argc,
  669.                 char *argv[]));
  670. extern void        TkInitXId _ANSI_ARGS_((TkDisplay *dispPtr));
  671. extern void        TkInOutEvents _ANSI_ARGS_((XEvent *eventPtr,
  672.                 TkWindow *sourcePtr, TkWindow *destPtr,
  673.                 int leaveType, int EnterType));
  674. extern int        TkLineToArea _ANSI_ARGS_((double end1Ptr[2],
  675.                 double end2Ptr[2], double rectPtr[4]));
  676. extern double        TkLineToPoint _ANSI_ARGS_((double end1Ptr[2],
  677.                 double end2Ptr[2], double pointPtr[2]));
  678. extern int        TkMakeBezierCurve _ANSI_ARGS_((Tk_Canvas canvas,
  679.                 double *pointPtr, int numPoints, int numSteps,
  680.                 XPoint xPoints[], double dblPoints[]));
  681. extern void        TkMakeBezierPostscript _ANSI_ARGS_((Tcl_Interp *interp,
  682.                 Tk_Canvas canvas, double *pointPtr,
  683.                 int numPoints));
  684. extern int        TkMeasureChars _ANSI_ARGS_((XFontStruct *fontStructPtr,
  685.                 char *source, int maxChars, int startX, int maxX,
  686.                 int tabOrigin, int flags, int *nextXPtr));
  687. extern void        TkOptionClassChanged _ANSI_ARGS_((TkWindow *winPtr));
  688. extern void        TkOptionDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  689. extern int        TkOvalToArea _ANSI_ARGS_((double *ovalPtr,
  690.                 double *rectPtr));
  691. extern double        TkOvalToPoint _ANSI_ARGS_((double ovalPtr[4],
  692.                 double width, int filled, double pointPtr[2]));
  693. extern int        TkPointerEvent _ANSI_ARGS_((XEvent *eventPtr,
  694.                 TkWindow *winPtr));
  695. extern int        TkPolygonToArea _ANSI_ARGS_((double *polyPtr,
  696.                 int numPoints, double *rectPtr));
  697. extern double        TkPolygonToPoint _ANSI_ARGS_((double *polyPtr,
  698.                 int numPoints, double *pointPtr));
  699. extern void        TkQueueEvent _ANSI_ARGS_((TkDisplay *dispPtr,
  700.                 XEvent *eventPtr));
  701. extern void        TkSelDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  702. extern void        TkSelEventProc _ANSI_ARGS_((Tk_Window tkwin,
  703.                 XEvent *eventPtr));
  704. extern void        TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
  705. extern void        TkSelPropProc _ANSI_ARGS_((XEvent *eventPtr));
  706. extern int        TkThickPolyLineToArea _ANSI_ARGS_((double *coordPtr,
  707.                 int numPoints, double width, int capStyle,
  708.                 int joinStyle, double *rectPtr));
  709. extern void        TkUnderlineChars _ANSI_ARGS_((Display *display,
  710.                 Drawable drawable, GC gc,
  711.                 XFontStruct *fontStructPtr, char *string,
  712.                 int x, int y, int tabOrigin, int flags,
  713.                 int firstChar, int lastChar));
  714. extern void        TkWmAddToColormapWindows _ANSI_ARGS_((
  715.                 TkWindow *winPtr));
  716. extern void        TkWmDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  717. extern void        TkWmMapWindow _ANSI_ARGS_((TkWindow *winPtr));
  718. extern void        TkWmNewWindow _ANSI_ARGS_((TkWindow *winPtr));
  719. extern void        TkWmProtocolEventProc _ANSI_ARGS_((TkWindow *winPtr,
  720.                 XEvent *evenvPtr));
  721. extern void        TkWmRestackToplevel _ANSI_ARGS_((TkWindow *winPtr,
  722.                 int aboveBelow, TkWindow *otherPtr));
  723. extern void        TkWmSetClass _ANSI_ARGS_((TkWindow *winPtr));
  724. extern void        TkWmUnmapWindow _ANSI_ARGS_((TkWindow *winPtr));
  725. extern int        TkXFileProc _ANSI_ARGS_((ClientData clientData,
  726.                 int mask, int flags));
  727.  
  728. #endif  /* _TKINT */
  729.